package com.quyeying.utils.result;

/**
 * @ClassName ResultEnum
 * @Description TODO
 * @Author skx
 * @Date 2020/10/20
 */
public enum ResultEnum {
    //这里是可以自己定义的，方便与前端交互即可
    UNKNOWN_ERROR(-1,"未知错误"),
    SYSTEM_ERROR(-2, "系统错误"),
    SUCCESS(1,"成功"),
    USER_NOT_EXIST(0,"用户不存在"),
    USER_IS_EXISTS(2,"用户已存在"),
    DATA_IS_NULL(3,"数据为空"),
    MISS_PARAM(4, "缺少参数"),
    PASSWORD_ERR(5, "密码错误"),
    NOT_NULL_TOKEN(6, "token为空"),
    INVALID_TOKEN(7, "无效token"),
    EXPIRED_TOKEN(8, "token已过期"),
    INVALID_INVITE_CODE(9, "链接已过有效期"),
    DATA_IS_NOT_NULL(10,"对象数据不为空"),
    PRODUCT_IS_NULL(11,"商品不存在或已下架"),
    PRODUCT_STOCK_INSUFFICIENT(12,"商品库存不足"),
    EXCEEDED_MAX_CATEGORY_LEVEL(13,"超出最大分类层级！"),
    VERIFYCODE_INVALID(14, "验证码无效"),
    ;

    private Integer code;
    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
